import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity('member')
export class Member {
  @PrimaryGeneratedColumn({
    name: 'member_id',
    type: 'int',
    comment: '会员id',
  })
  memberId: number;

  @Column({
    name: 'avatar_id',
    type: 'int',
    default: 0,
    comment: '头像id',
  })
  avatarId: number;

  @Column({
    name: 'headimgurl',
    type: 'varchar',
    length: 255,
    default: '',
    comment: '第三方账号头像',
  })
  headimgurl: string;

  @Column({
    name: 'nickname',
    type: 'varchar',
    length: 127,
    nullable: false,
    default: '',
    comment: '昵称',
  })
  nickname: string;

  @Column({
    name: 'username',
    type: 'varchar',
    length: 127,
    nullable: false,
    default: '',
    comment: '用户名',
  })
  username: string;

  @Column({
    name: 'phone',
    type: 'varchar',
    length: 12,
    default: '',
    comment: '手机',
  })
  phone: string;

  @Column({
    name: 'email',
    type: 'varchar',
    length: 255,
    default: '',
    comment: '邮箱',
  })
  email: string;

  @Column({
    name: 'password',
    type: 'varchar',
    length: 255,
    nullable: false,
    default: '',
    comment: '密码',
  })
  password: string;

  @Column({
    name: 'name',
    type: 'varchar',
    length: 255,
    default: '',
    comment: '姓名',
  })
  name: string;

  @Column({
    name: 'gender',
    type: 'tinyint',
    default: 0,
    comment: '性别，0未知，1男，2女',
  })
  gender: number;

  @Column({
    name: 'region_id',
    type: 'int',
    default: 0,
    comment: '所在地id',
  })
  regionId: number;

  @Column({
    name: 'remark',
    type: 'varchar',
    length: 255,
    default: '',
    comment: '备注',
  })
  remark: string;

  @Column({
    name: 'sort',
    type: 'int',
    width: 10,
    default: 250,
    comment: '排序',
  })
  sort: number;

  @Column({
    name: 'platform',
    type: 'tinyint',
    default: 0,
    comment: '注册平台',
  })
  platform: number;

  @Column({
    name: 'application',
    type: 'tinyint',
    default: 0,
    comment: '注册应用',
  })
  application: number;

  @Column({
    name: 'login_num',
    type: 'int',
    width: 10,
    default: 0,
    comment: '登录次数',
  })
  loginNum: number;

  @Column({
    name: 'login_ip',
    type: 'varchar',
    length: 20,
    default: '',
    comment: '登录IP',
  })
  loginIp: string;

  @Column({
    name: 'login_region',
    type: 'varchar',
    length: 255,
    default: '',
    comment: '登录地区',
  })
  loginRegion: string;

  @Column({
    name: 'login_time',
    type: 'datetime',
    nullable: true,
    comment: '登录时间',
  })
  loginTime: Date;

  @Column({
    name: 'logout_time',
    type: 'datetime',
    nullable: true,
    comment: '退出时间',
  })
  logoutTime: Date;

  @Column({
    name: 'pwd_time',
    type: 'datetime',
    nullable: true,
    comment: '密码修改时间',
  })
  pwdTime: Date;

  @Column({
    name: 'is_super',
    type: 'tinyint',
    nullable: false,
    default: 0,
    comment: '是否超会，1是0否',
  })
  isSuper: number;

  @Column({
    name: 'is_disable',
    type: 'tinyint',
    nullable: false,
    default: 0,
    comment: '是否禁用，1是0否',
  })
  isDisable: number;

  @Column({
    name: 'is_delete',
    type: 'tinyint',
    nullable: false,
    default: 0,
    comment: '是否删除，1是0否',
  })
  isDelete: number;

  @Column({
    name: 'create_uid',
    type: 'int',
    default: 0,
    comment: '添加用户id',
  })
  createUid: number;

  @Column({
    name: 'update_uid',
    type: 'int',
    default: 0,
    comment: '修改用户id',
  })
  updateUid: number;

  @Column({
    name: 'delete_uid',
    type: 'int',
    default: 0,
    comment: '删除用户id',
  })
  deleteUid: number;

  @Column({
    name: 'create_time',
    type: 'datetime',
    nullable: true,
    comment: '注册时间',
  })
  createTime: Date;

  @Column({
    name: 'update_time',
    type: 'datetime',
    nullable: true,
    comment: '修改时间',
  })
  updateTime: Date;

  @Column({
    name: 'delete_time',
    type: 'datetime',
    nullable: true,
    comment: '删除时间',
  })
  deleteTime: Date;
}